package com.dragon.repository.entity;


import com.dragon.common.constant.PlatformConstant;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class AdminToken implements Serializable {


    /**
     * 用户id
     */
    private Integer id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 是否是管理员
     */
    private Integer isAdmin;

    /**
     * 授权码
     */
    private Integer authCode;


    /**
     * token md5字符串
     */
    private String md5TokenStr;
    /**
     * 部门集合
     */
    private String departmentSet;

    /**
     * 平台字段
     */
    private PlatformConstant platformConstant;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expiresAt;

    // 是否记住我
    private Boolean remember;
}
